package com.hibernate.hrm.entity.dto.employee;

import com.hibernate.hrm.entity.Position;
import com.hibernate.hrm.entity.User;
import com.hibernate.hrm.entity.dto.position.PositionDTO;

public class UserDTO {
    private Integer userId;
    private String username;
    private String realName;
    private PositionDTO jobPosition;

    public UserDTO(User user) {
        this.userId = user.getUserId();
        this.username = user.getUsername();
        this.realName = user.getRealName();
        if (user.getJobPositionID() != null) {
            this.jobPosition = new PositionDTO(user.getJobPositionID());
        }
    }

    // getters
    public Integer getUserId() { return userId; }
    public String getUsername() { return username; }
    public String getRealName() { return realName; }
    public PositionDTO getJobPosition() { return jobPosition; }
}
